package com.edu.app.threadlocal;

public class TenantContext {
    private static ThreadLocal<Object> currentTenant = new ThreadLocal<>();

    public static void setCurrentTenant(Object tenant) {
        currentTenant.set(tenant);
    }

    public static Object getCurrentTenant() {
        return currentTenant.get();
    }

    private static ThreadLocal<Boolean> bNeedTenantIdLocal = new ThreadLocal<>();
    public static Boolean getNeedTenantId() {
        return bNeedTenantIdLocal.get();
    }

    public static void setNeedTenantId(Boolean bNeedTenantId) {
        bNeedTenantIdLocal.set(bNeedTenantId);
    }

}
